unit ProcedureDelFromEnd;

interface

type
  PElement = ^TElement;
  TElement = record
    value: integer;
    Next: PElement;
  end;

procedure DelFromEnd( head: PElement );

implementation

procedure DelFromEnd( head: PElement );
var
  i: integer;
  current: PElement;
begin
  current := head;
  while current^.Next^.Next <> nil do
    current := current^.Next;
  dispose( current^.Next^.Next );
  current^.Next := nil;
end;

end.
 